<?php
$servername = "127.0.0.1";
$username = "root";
$password = "";
$dbname = "yuangongbiao";

// 创建连接

$conn = new mysqli($servername, $username, $password, $dbname);

$conn->query("set names utf8");


if ($conn->connect_error) {
    ("连接失败: " . $conn->connect_error);
}
$sql="SELECT * FROM `yuangongbiao`";
$result=$conn->query($sql);

if($result->num_rows > 0){
    while ($row=$result->fetch_assoc()){
        echo $row ['id'].$row ['name'];
    }
}

 
?>
















